﻿using Fuse8.DomainFramework.Domain;
using Fuse8.GlobalizationFramework.Infrastructure;

namespace Fuse8.GlobalizationFramework.Domain.Commands
{
    /// <summary>
    /// Command for retrieve resource by key and locale
    /// </summary>
    public abstract class ResourceByKeyAndLocale : BaseEntityCommand<Resource>, ILocalizableEntity
    {        
        /// <summary>
        /// Command name
        /// </summary>
        public override string CommandName
        {
            get { return "ResourceByKeyAndLocale"; }
        }

        /// <summary>
        /// Cache key
        /// </summary>
        public override string CacheKey
        {
            get { return string.Format("Key_{0};Locale_{1}", Key, Locale); }
        }

        /// <summary>
        /// Key parameter
        /// </summary>
        public string Key { get; set; }

        /// <summary>
        /// Locale parameter
        /// </summary>
        public string Locale { get; set; }
    }
}